{% extends 'base.html' %}

{% block title %}登录{% endblock %}

{% block head %}{% endblock %}
<link rel="stylesheet" href="{{ url_for('static', filename='css/login_register.css') }}">
<script src="/static/jquery/jquery-3.4.1.min.js"></script>
{% block main %}
    <div style="text-align: center;"><h3>登录</h3></div>
    <form action="" method="POST">
    {{ forms.csrf_token  }}
        <div class="form-container">
            <div class="form-group">
                {{forms.username(class="form-control", placeholder="请输入用户名") }}
            </div>
            <div class="form-group">
                {{ forms.password(class="form-control",placeholder="请输入密码") }}
            </div>
            <div class="form-group">
                {{ forms.submit(class="btn btn-primary btn-block") }}
            </div>
        </div>
    </form>
    {#{% for message in get_flashed_messages() %}
        {{ message }}
    {% endfor %}#}
    <div class="alter">
    {% for category,message in get_flashed_messages(with_categories=True) %}
        <div  class="alert alert-{{ category }} alert-dismissable">
        <button type="button" class="close" data-dismiss="alert"></button>
        {{ message }}
        </div>
    {% endfor %}
    </div>
    <script>
        $(document).ready(function(){
            $(".form-control").click(function () {
                $(".alert").remove();
            });
        });
    </script>
{% endblock %}